// pages/buy_card/buy_card.js
const app = getApp();
Page({

  data: {
    cards:[],
    spinShow:true,
    switch:false
  },

  onLoad: function (options) {
    var that = this;
    wx.request({
      url: app.url + 'weiapp/api/getCard',
      success: function (res) {
        console.log(res.data)
        that.setData({
          cards: res.data
        })
      }
    })
  },

  goCardDetail(event){
    //console.log(event.currentTarget.dataset.id)
    wx.navigateTo({
      url: '../card_detail/card_detail?id=' + event.currentTarget.dataset.id,
    })
  },
  goActivate(event){
    console.log(1)
  }
})